package com.itheima.reggie.common;

import com.itheima.reggie.domain.Employee;

//员工持有者
public class EmployeeHolder {

    //定义私有静态常量
    private static final ThreadLocal<Employee> TL = new ThreadLocal<>();

    //存
    public static void set(Employee employee){
        TL.set(employee);
    }

    //取
    public static Employee get(){
        return TL.get();
    }

    //释放
    public static void remove(){
        TL.remove();
    }
}
